home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
MATHS
/
RLAB
/
RLAB125.ZIP
/
!RLaB
/
help_ai
/
cumsum
< prev
next >
Wrap
Text File
|
1995-02-18
|
714b
|
30 lines
cumsum:
Syntax: cumsum ( A )
Description:
cumsum computes the running, or cumulative sum of a vector or
matrix. The return object is a matrix the same size as the
input, A. If A is a rectangular matrix, then the cumulative
sums are performed over the columns of the matrix.
Example:
> a = 1:4
a =
1 2 3 4
> cumsum(a)
1 3 6 10
> a= [1,2,3;4,5,6;7,8,9]
a =
1 2 3
4 5 6
7 8 9
> cumsum (a)
1 2 3
5 7 9
12 15 18
See Also: cumprod, prod, sum